<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<link rel="stylesheet" type="text/css"
			href="${contextPath}/resource/css/default.css" />
		<script src="${contextPath}/resource/js/index.js"></script>
		<script type="text/javascript">
			function validate(fm){
				if(document.getElementById("agency.orgNm").value == ''){
						alert("机构名称不能为空");
						return;
				}
				if(document.getElementById("agency.orgNo").value == ''){
						alert("机构编号不能为空");
						return;
				}
				document.getElementById('subbut').disabled=true;
				fm.submit();
			}
		</script>
	</head>
	<body >
			<table class="menu_table">
				<tr>
					<th>
						<a href="agencyAction_list.do?suprOrgNo=0">机构管理</a>&gt;&gt;添加导航机构
					</th>
				</tr>
			</table>
<div class="listtable">
	<div class="secondDiv">
		<table class="data_js_table" id="js_table">
			<tr>
				<th width="15%">机构名字</th>
				<th width="15%">级别</th>
				<th width="15%">机构编号</th>
				<th>操作</th>
			</tr>
			<s:iterator value="listTagency" var="agy">
				<tr><td class="VTSMA">
					<a href="agencyAction_view.do?suprOrgNo=${agy.orgNo}"><s:property value="#agy.orgNm" /></a>
					</td>
					<td><s:property value="#agy.orgRnk" /></td>
					<td><s:property value="#agy.orgNo" /></td>
					<td>
						<s:if test="buttonGrpMap['view']">
							<a href="agencyAction_add.do?suprOrgNo=${agy.orgNo}" title="新增">
								<img src="${contextPath}/resource/img/ico/addlist.png" class="delete_style" align="middle" alt="新增"></img>
							</a>
						</s:if>
						<s:if test="buttonGrpMap['edit']">
							&nbsp;|&nbsp;
							<a href="agencyAction_edit.do?agency.orgNo=${agy.orgNo}" title="修改">
								<img src="${contextPath}/resource/img/ico/edit.png" class="edit_style" align="middle" alt="修改"></img>
							</a>
						</s:if>	
						<s:if test="buttonGrpMap['delete']">
							&nbsp;|&nbsp;
							<a href="javascript:void(0)" onclick="isPost('确认删除?','agencyAction_delete.do?agency.orgNo=${agy.orgNo}')" title="删除">
								<img src="${contextPath}/resource/img/ico/delete.png" class="delete_style" align="middle" alt="删除"></img>
							</a>
						</s:if>	
					</td>
				</tr>
			</s:iterator>
			<s:if test="listTagency.size == 0"><tr><td colspan="4"><font color="#ff00ff" size="3">暂无数据</font></td></tr></s:if>
						</table></div></div>
		<s:form action="agencyAction_save.do" method="post" namespace="/" >
				<div class="listtable">
		<div class="secondDiv">
 
			<table class="data_js_table">
				<tr><th>
					新增机构
				</th></tr>
			</table>
			<s:hidden name="agency.arGrp" value="%{agency.arGrp}"></s:hidden>
			<table class="form_table">
				<%@include file="/show_field_error.jsp"%>
				<tr>
					<th>上级机构编号</th>
					<s:hidden name="agency.suprOrgNo" value="%{suprOrgNo}" />
					<td colspan="3">${suprOrgNo}</td>
				</tr>
				<tr>
					<th width="10%">机构名</th>
					<td width="30%">
						<s:textfield name="agency.orgNm" id="agency.orgNm" size="20" maxlength="50" /><span class="txtblue">*</span>
					</td>
					<th width="10%">机构编号</th>
					<td>
						<s:textfield name="agency.orgNo" id="agency.orgNo" size="20" maxlength="10" /><span class="txtblue">*</span>
					</td>
				</tr>
				<tr>
					<th >机构级别</th>
					<td  colspan="3"><s:textfield name="agency.orgRnk" id="agency.orgRnk" size="20" /></td>
					<!-- 
					<th>颜色编号</th>
					<td><s:textfield name="agency.clrNo" id="agency.clrNo" size="20"/></td>
				</tr>
				<tr>
					<th>坐标类型</th>
					<td colspan="3"><s:textfield name="agency.crdnTyp" id="agency.crdnTyp" size="20" /></td>
				</tr>
				<tr>
					<th>坐标</th>
					<td colspan="3"><s:textarea name="agency.crdn" rows="4" cols="60" ></s:textarea></td> -->
				</tr>
				<tr>
					<th>详细描述</th>
					<td colspan="3">
					<s:textarea name="agency.dtlDesc" rows="4" cols="60"></s:textarea></td>
				</tr>
			</table>
			<table width="50%" border="0" align="center" cellpadding="3" cellspacing="1">
				<s:token></s:token>
			    <tr>
			      <td align="center"  >
			      <div align="center">
			      	<input name="subbut" type="button" id="subbut" class="apply_style" align="middle" value="" onclick="validate(this.form)" align="middle"/>
			        <input type="button" onclick="javascript:location='agencyAction_list.do?suprOrgNo=0'" class="back_style" align="middle" />
			        <input type="reset" id="重置 " class="reset_style" value="" align="middle"/>
			        </div>
			        </td>
			    </tr>
			</table>
		</div>
		</div>
		</s:form>
	</body>
</html>
